function queueTime(customers, n) {
    var arr = new Array(n).fill(0);
    for(var item of customers){
      var minValue = arr.indexOf(Math.min(...arr));
      arr[minValue] += item;
    }
    return Math.max(...arr); //es6写法
 }
  var value = queueTime([2, 2, 3, 3, 4, 4], 2);
  